<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/statics/css/font-awesome-4.7.0/css/font-awesome.min.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/statics/css/style.css">
    <script src="${pageContext.request.contextPath}/statics/js/jquery.min.js"></script>
    <script src="${pageContext.request.contextPath}/statics/js/index.js"></script>
</head>

<body>
<div class="materialContainer">
    <div class="box">
        <form action="${pageContext.request.contextPath}/account/login" method="post">
            <div class="title">登录</div>
            <div class="input">
                <input type="text" name="username" id="name" placeholder="用户名">
                <span class="spin"></span>
            </div>
            <div class="input">
                <input type="password" name="password" id="pass" placeholder="密码">
                <span class="spin"></span>
            </div>
            <div class="button login">
                <button type="submit">
                    <span>登录</span>
                    <i class="fa fa-check"></i>
                </button>
            </div>
        </form>
    </div>

    <div class="overbox">
        <div class="material-button alt-2">
            <span class="shape"></span>
        </div>
        <form action="${pageContext.request.contextPath}/account/register" method="post" onsubmit="return check(this)">
            <div class="title">注册</div>
            <div class="input">
                <input type="text" name="username" id="regusername" placeholder="用户名">
                <span class="spin"></span>
            </div>
            <div class="input">
                <input type="password" name="password" id="regpass" placeholder="密码">
                <span class="spin"></span>
            </div>
            <div class="input">
                <input type="password" name="rePassword" id="reregpass" placeholder="确认密码">
                <span class="spin"></span>
            </div>
<%--            <div class="input">--%>
<%--                <input type="text" name="name" id="regname" placeholder="昵称">--%>
<%--                <span class="spin"></span>--%>
<%--            </div>--%>
<%--            <div class="input">--%>
<%--                性别：--%>
<%--            <input name="sex" type="radio" value="男" />男--%>
<%--            <input name="sex" type="radio" value="女" />女<br><br>--%>
<%--            </div>--%>
<%--            <div class="input">--%>
<%--                <input type="date" name="birth" id="regbirth" placeholder="生日">--%>
<%--                <span class="spin"></span>--%>
<%--            </div>--%>
<%--            <div class="input">--%>
<%--                <input type="text" name="signature" id="regsignature" placeholder="个性签名">--%>
<%--                <span class="spin"></span>--%>
<%--            </div>--%>
<%--            <div class="input"><input type="file" name="photo" title="点击上传头像" style="width: 20%;margin-left: auto;margin-right: auto"/><br></div>--%>
            <div class="button">
                <button type="submit">
                    <span>注册</span>
                </button>
            </div>
        </form>
    </div>
</div>

<script language="JavaScript">
    function check(theForm){
        if(theForm.username.value == ""){
            alert("用户名不能为空！");
            theForm.password.focus();
            return (false);
        }
        if (theForm.password.value.length < 6){
            alert("密码不能小于6位！");
            theForm.password.focus();
            return (false);
        }
        if(theForm.password.value != theForm.rePassword.value){
            alert("两次密码输入不一致，请重新输入！");
            theForm.rePassword.focus();
            return (false);
        }
        return (true);
    }

    function Return(){
        history.back()
    }
</script>

</body>
</html>